package com.xunk.scene.config;

import com.xunk.scene.interceptor.TimerInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ProjectName: HIM
 * @Package: com.xunk.scene.config
 * @ClassName: WebConfig
 * @Author: tangguangyuan
 * @Description: 拦截器配置
 * @Date: 2021/5/7 16:25
 * @Version: 1.0
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Autowired
    private TimerInterceptor timerInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(timerInterceptor).addPathPatterns("/timer/**");
        WebMvcConfigurer.super.addInterceptors(registry);
    }
}
